#pragma once
#include "ScaleformTypes.h"

namespace Scaleform
{
    namespace Render
    {
        enum EdgeAAMode
        {
            EdgeAA_Inherit = 0x0000,
            EdgeAA_On = 0x0004,
            EdgeAA_Off = 0x0008,
            EdgeAA_Disable = 0x000C
        };

        class TreeContainer
        {
        };

        class TreeRoot : public TreeContainer
        {
        };

        class Viewport
        {
        public:
            s32 BufferWidth, BufferHeight;
            s32 Left, Top;
            s32 Width, Height;
            s32 ScissorLeft, ScissorTop; // scissor left & top are in same coords as Left & Top (in buffer's ones)
            s32 ScissorWidth, ScissorHeight;
            float Scale, AspectRatio;
            u32 Flags;

            enum
            {
                View_IsRenderTexture = 1,
                View_AlphaComposite = 2,
                View_UseScissorRect = 4,
                View_NoSetState = 8,
                View_RenderTextureAlpha = View_IsRenderTexture | View_AlphaComposite
            };
        };

        class Color
        {
            struct Rgb32
            {
                UByte Alpha;
                UByte Red;
                UByte Green;
                UByte Blue;
            };

            enum Model
            {
                Rgb,
                Hsv,
                Hsi,
                Cmy,
                Xyz,
                Lab,
                Luv,
                Yiq,
                Yuv
            };

            /*enum StandardAlphas
            {
                Alpha0 = SF_RGBA(0, 0, 0, 0),
                Alpha25 = SF_RGBA(0, 0, 0, 64),
                Alpha50 = SF_RGBA(0, 0, 0, 127),
                Alpha75 = SF_RGBA(0, 0, 0, 191),
                Alpha100 = SF_RGBA(0, 0, 0, 255)
            };

            enum StandardColors
            {
                Black = SF_RGB(0, 0, 0),
                White = SF_RGB(255, 255, 255),
                VeryLightGray = SF_RGB(224, 224, 224),
                LightGray = SF_RGB(192, 192, 192),
                Gray = SF_RGB(128, 128, 128),
                DarkGray = SF_RGB(64, 64, 64),
                VeryDarkGray = SF_RGB(32, 32, 32),
                Red = SF_RGB(255, 0, 0),
                LightRed = SF_RGB(255, 128, 128),
                DarkRed = SF_RGB(128, 0, 0),
                VeryDarkRed = SF_RGB(64, 0, 0),
                Green = SF_RGB(0, 255, 0),
                LightGreen = SF_RGB(128, 255, 128),
                DarkGreen = SF_RGB(0, 128, 0),
                VeryDarkGreen = SF_RGB(0, 64, 0),
                Blue = SF_RGB(0, 0, 255),
                LightBlue = SF_RGB(128, 128, 255),
                DarkBlue = SF_RGB(0, 0, 128),
                VeryDarkBlue = SF_RGB(0, 0, 64),
                Cyan = SF_RGB(0, 255, 255),
                LightCyan = SF_RGB(128, 255, 255),
                DarkCyan = SF_RGB(0, 128, 128),
                Magenta = SF_RGB(255, 0, 255),
                LightMagenta = SF_RGB(255, 128, 255),
                DarkMagenta = SF_RGB(128, 0, 128),
                Yellow = SF_RGB(255, 255, 0),
                LightYellow = SF_RGB(255, 255, 128),
                DarkYellow = SF_RGB(128, 128, 0),
                Purple = SF_RGB(255, 0, 255),
                DarkPurple = SF_RGB(128, 0, 128),
                Pink = SF_RGB(255, 192, 192),
                DarkPink = SF_RGB(192, 128, 128),
                Beige = SF_RGB(255, 192, 128),
                LightBeige = SF_RGB(255, 224, 192),
                DarkBeige = SF_RGB(192, 128, 64),
                Orange = SF_RGB(255, 128, 0),
                Brown = SF_RGB(128, 64, 0),
                LightBrown = SF_RGB(192, 96, 0),
                DarkBrown = SF_RGB(64, 32, 0)
            };*/
        };

        template <class T>
        class Rect
        {
        public:
            T x1;
            T y1;
            T x2;
            T y2;
        };

        typedef Rect<Double> RectD;
        typedef Rect<float> RectF;

        template <class T>
        class Matrix2x4
        {
        public:
            T m[2][4];
        };
        typedef Matrix2x4<float> Matrix2F;
        
        template <class T>
        class Matrix3x4
        {
        public:
            T m[3][4];
        };
        typedef Matrix3x4<float> Matrix3F;

        template <class T>
        class Matrix4x4
        {
        public:
            T m[4][4];
        };
        typedef Matrix4x4<float> Matrix4F;

        template <class T>
        class Point
        {
        public:
            T x;
            T y;            
        };
        typedef Point<float> PointF;
    }

    namespace ContextImpl
    {
        class Context;
        class Entry;
        class EntryChange;
        class RenderNotify;

        class RTHandle
        {
        };

        template <class C>
        class DisplayHandle : public RTHandle
        {
        };

        typedef DisplayHandle<Render::TreeRoot> MovieDisplayHandle;
    }

    namespace GFx
    {
        class Viewport : public Render::Viewport
        {
        };
    }
};
